package com.tfswue.lsh.controller;

import com.tfswue.lsh.service.EventPublisherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class RegestController {

    @Autowired
    private EventPublisherService eventPublisherService;

    @PostMapping("/register")
    public ResponseEntity<String> registerUser(@RequestParam String username,
                                               @RequestParam String email) {
        // 业务处理...
        eventPublisherService.publishUserRegisteredEvent(username, email);
        return ResponseEntity.ok("用户注册成功！");
    }
}